package com.feng.controller;

import com.feng.entity.RestResponse;
import com.feng.exception.SystemException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionController {

    @ExceptionHandler(SystemException.class)
    public RestResponse handleException(SystemException e){
        return RestResponse.failure(e.getCode(), e.getMessage());
    }
}
